require("reshape")
require("ggplot2")

b <- read.csv ( file = "benchmark.csv", sep = ",", header= TRUE)
attach(b)
bf <- data.frame ( bts=b$BTS, income=b$MaximalIncome, i=b$i, algorithm=b$Algorithm, ms=b$microsecondes )
obf <- bf[order( bf$algorithm, bf$bts, bf$income, bf$i),]

print (obf[1,4])

x = obf [ obf$algorithm == " Greedy", 1]
y = obf [ obf$algorithm == " Greedy", 5]
fx = x * x

x
y

newFrame <- data.frame ( size=fx, time=y )

qplot (
  newFrame$size, newFrame$time, data = newFrame,
  ylab= "Temps expérimental",
  xlab= "Temps théorique",
  color = time,
  geom = c("point", "smooth"),
)
ggsave (paste ( "../rapport/src/img/constAnalysis_Greedy.pdf", sep=""))

print ( lm ( y ~ x ) )
